With the addition of EBCDIC support, NoteTab has become a valuable tool for any project involving editing or converting EBCDIC files from MVS and AS/400 systems. As a result, you can now use NoteTab for those huge Y2K projects.
EBCDIC files that do not contain packed-decimal fields can be opened, edited, and saved in the commercial and trial versions of NoteTab. Such files can either be opened through the new ^!OpenEbcdic Clip command, or by using a file filter containing the text "EBCDIC" (based on the same principle as opening Dos ASCII files). The Export command can also be used to save text in EBCDIC format. Although NoteTab supports EBCDIC files with line breaks and those with fixed-width text, it cannot correctly read EBCDIC files with variable-length records (i.e. those without line breaks).
NB: If you are using NoteTab Light, you will only be able to read EBCDIC files. It will not let you edit, save, or copy the text to the Clipboard. However, if you enable the trial mode (available for one month), you will be able to edit and save EBCDIC files just like the commercial versions of NoteTab.
How to add an EBCDIC file filter
If you have upgraded from a NoteTab release prior to version 4.6, you probably need to add an EBCDIC file filter yourself, as the default settings will have been taken from the INI file of your previous version. Just open the Options dialog box (from under the View menu) and activate the File Filters tab. Click on the New button to add a new entry in the list, then add the text "EBCDIC files" (without the quotes) in the Description field, and the wild cards that match your EBCDIC file names (the following are typical values: "*.cbl;*.cob;*.cpy;*ddl;*.bms") in the Wild Cards field. Finally, use the Move Up/Down buttons, or drag-and-drop the added item to the position in the list that you prefer, and then click on OK to close the dialog box. Now, you will see your new file filter in the File Open dialog box when you next choose to open a file.
How to open an EBCDIC file
1. Choose the Open command from the File menu or the toolbar. Select the file filter for EBCDIC files (if you do not have this filter, follow the procedure described in the previous paragraph), choose the file you want to open (you can select multiple files), and click on OK. At this stage, NoteTab will try to determine the format of the file. If it detects line breaks, it will assume that the file contains variable-length lines. If not, NoteTab checks if the file size matches fixed-width lines of 80, 132, or 133 characters. If it does, NoteTab will open the file according to the matching format. If not, NoteTab will prompt you for the line length used in the file you are opening.
2. Open the "Utilities" Clipbook library – you can do this by clicking on the button labeled "Utilities" at the bottom of the NoteTab window. You will see a Clip labeled "Open EBCDIC document" under the "EBCDIC files" section. Double-click on the Clip to activate it. You will then be presented with a Clip wizard with a field for the file name and the LRECL format. Complete the fields and click on OK to open the EBCDIC file.
Next time, when you want to reopen such a file, NoteTab remembers its original format (in the properties file), so the text will be correctly displayed if you use the Favorites tool or the File|Reopen submenu. However, if you change the format with another program, you should use NoteTab's File Open dialog box with the appropriate filter so that the text is not interpreted as being EBCDIC.
How to save a document in EBCDIC format
NoteTab saves documents based on the "Save As" format setting defined either in the general options (if default properties are used), or in the document properties. The general options are configured through NoteTab's Options dialog box (under the View menu) on the Documents tab, and the document's properties are set in the Document Properties dialog box available from the Document menu.
If the "Save As" format is set to "Original", a file opened as EBCDIC will automatically be saved in EBCDIC format. If the option is set to EBCDIC, then all the documents to which this setting applies will be saved in EBCDIC format. Any other format will result in a non-EBCDIC file.
If you want to create a new EBCDIC document, use the New command from the File menu or the toolbar to create a new document. Then open the Document Properties dialog box (from the Document menu) and change the "Save As" setting to EBCDIC. As a result, the next time you save this document, it will be stored on disk in EBCDIC format.
You can also create an EBCDIC copy of any document (irrespective of the original format) or selection of text by using the Export command under the File menu.
Using alternative EBCDIC conversion tables
The default conversion table is stored in a file called "Default.ebc" in the NoteTab program directory. It is based on the US character set. This is a plain text file that can be edited in NoteTab. Characters are represented as hexadecimal numbers. The values are placed in chronological order, one set of values per line, starting at 00h and ending at FFh. You can create as many conversion tables as you like, each one in its own file.
When an EBCDIC file is opened or saved, NoteTab uses the last loaded table, or the default internal table if none was loaded, to perform the character conversion between EBCDIC and ANSI. You can either load the conversion table when NoteTab is started, by using the "/T" command-line parameter, or use the Clip command "^!LoadEbcdicCharTable", or use the Clip labeled "Load EBCDIC conversion table" in the Utilities library.
EBCDIC related Clip commands
^!LoadEbcdicCharTable FileName
Loads the specified file containing the EBCDIC character tables for conversion to and from Windows ANSI. The NoteTab program path is added if you do not specify a fully qualified path name. The extension .ebc is added if you do not specify a filename extension. You can reset the default character table by specifying the Default.ebc file.
^!OpenEbcdic FileName [/W=nnn]
or
^!OpenEbcdic FileName1;FileName2;FileName3
Opens and translates the text from EBCDIC format to ANSI, or selects the specified document "FileName". You can use wild cards with this command. The optional parameter "/W=nnn" can be used to define a line length for fixed-width EBCDIC files. "nnn" represents the width in characters; a value of 0 indicates variable line lengths delimited with carriage returns. Example:
^!OpenEbcdic /W=132
^!SaveEbcdic FileName [/W=nnn]
Similar to the ^!Save command (and accepts the same parameters) but saves the document in EBCDIC format. The optional parameter "/W=nnn" can be used to define a line length for fixed-width EBCDIC files. "nnn" represents the width in characters; a value of 0 indicates variable line lengths delimited with carriage returns. Example:
^!SaveEbcdic /W=132